/*
TG DPS.  Simulate warrior dps with titan's grip.
Copyright (C) 2008 David Warburton

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>

enum hit_type {MISS, HIT, CRIT};

extern int verbose;

#define OUT_STORY   0x01
#define OUT_RAGE    0x02
#define OUT_RAMPAGE 0x04
#define OUT_STARVE  0x08

int roll(int min, float max);

typedef class weapon
{
public:
	int min;
	int max;
	int speed;
	bool twohands;

	weapon() {
		min = max = speed = 0;
		twohands = false;
	}
	weapon (int i, int a, int s, bool t) {
		min = i; max = a; speed = s; twohands = t;
	}

} *WEAPON;

typedef class player
{
	public:
	int ap;
	int crit;
	int rage;
	int WW_cd, BT_cd, gcd;
	int flurry_charges;
	int rampage_avail, slam_avail;
	int rampage_crit_bonus;
	int mtick, otick;
	double haste_mod;
	bool HS;
	int starve;
	int hit_rating;
	WEAPON main;
	WEAPON off;


	player (int a, int c);
	int get_ap();
	int get_crit();
	int get_miss(int ab);
	int autoattack(WEAPON w, hit_type *result);

	int do_slam(int now);
	int do_WW(int);
	int do_BT(int now);

	void model(int duration);
} *PLAYER;
